package com.glodon.paas.mail;

import java.util.HashMap;
import java.util.Map;

/**
 * 类mailClient.java的实现描述：TODO 类实现描述 
 * @author a 2012-12-26 下午01:24:37
 */
public class MailClientT {	
	
	public static void main(String[] args) {
		MailClientHttpImpl mailClient = new MailClientHttpImpl();
		mailClient.setMailApiUrl("http://127.0.0.1:8080/account/api/internal");
		
		// 模板数据
		Map<String, Object> param = new HashMap<String, Object>();		
		param.put("userName", "test黄");
		param.put("userEmail", "hc@hc.com");
		param.put("docName", "春秋.doc");
		param.put("isFolder", "false");
		param.put("newUserEmail", "1001@new.com");
		param.put("newUserId", "12345678901234567");
		param.put("actionLink", "http://www.163.com");
		 
		// 邮件数据
		MailMessageParam mailContent = new MailMessageParam();
		mailContent.setTo(new String[]{"hch1011@163.com"});
		mailContent.setSubject("测试邮件1");	
		mailContent.setTemplateLocation("mailTemplate/document_shareDocMailForAbsentUser.vm");
		mailContent.setTemplateParam(param);
		
		//服务端同步发送邮件	
		mailClient.sendMail(mailContent, false);
		
		//服务端异步发送邮件
		mailContent.setSubject("测试邮件2");
		mailClient.sendMail(mailContent, true);
	}
}
